/**
 *
 * @author foliveira
 */
package general;

/**
 * Classe que implementa uma criptografia simples
 * @author foliveira
 */
public class Cript {
   
  
  public String cifra(String message,int k)
  {
    StringBuilder builder = new StringBuilder();
    
    for(int i=0;i<message.length();i++)
    {
      char c = (char)(message.charAt(i) + k);
      builder.append(c);
    }
   
    return builder.toString();
    
  }
  
  public String decifa(String message,int k)
  {
    return cifra(message, -k);
  }
  
  
  
}
